﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Matthias Friedrich">
//   Copyright © Matthias Friedrich 2013
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace Sample1
{
    using System;
    using System.Linq;

    using CommandlineHandling;

    internal class Program
    {
        // 	sample1.exe /x -y:1 -z:true
        private static void Main(string[] args)
        {
            Environment.GetCommandLineArgs();

            var handler = new CommandLineHandler();

            handler.Register<Options>("x");

            var options = (Options)handler.Parse(args).Single(x => x is Options);

            int number = options.Number;

            // 	let´s try to access the missing argument
            int oops = options.MissingParameter;
        }
    }
}